﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using Maticsoft.Common;
using LTP.Accounts.Bus;
namespace jnxc.Web.pprocessinfo
{
    public partial class Add : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
                       
        }

        		protected void btnSave_Click(object sender, EventArgs e)
		{
			
			string strErr="";
			if(!PageValidate.IsNumber(txtcaseid.Text))
			{
				strErr+="案例格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtstage.Text))
			{
				strErr+="阶段前0中1后2格式错误！\\n";	
			}
			if(!PageValidate.IsNumber(txtcid.Text))
			{
				strErr+="防治分类格式错误！\\n";	
			}
			if(!PageValidate.IsDecimal(txtnums.Text))
			{
				strErr+="数量格式错误！\\n";	
			}

			if(strErr!="")
			{
				MessageBox.Show(this,strErr);
				return;
			}
			int caseid=int.Parse(this.txtcaseid.Text);
			int stage=int.Parse(this.txtstage.Text);
			int cid=int.Parse(this.txtcid.Text);
			decimal nums=decimal.Parse(this.txtnums.Text);

			jnxc.Model.pprocessinfo model=new jnxc.Model.pprocessinfo();
			model.caseid=caseid;
			model.stage=stage;
			model.cid=cid;
			model.nums=nums;

			jnxc.BLL.pprocessinfo bll=new jnxc.BLL.pprocessinfo();
			bll.Add(model);
			jnxc.Common.MessageBox.ShowAndRedirect(this,"保存成功！","add.aspx");

		}


        public void btnCancle_Click(object sender, EventArgs e)
        {
            Response.Redirect("list.aspx");
        }
    }
}
